<form class="form-horizontal" role="form" method="get" action="<?=site_url('importw/history') ?>">  
  <div class="form-group">
    <label for="inputPassword3" class="col-sm-2 control-label">Tìm theo ngày</label>    	
	<div class="container">
	    <div class="row">
	        <div class='col-sm-3'>
	            <div class="form-group">
	                <div class='input-group date' id='datetimepicker5' data-date-format="YYYY/MM/DD">
	                    <input type='text' name="search" class="form-control" value="<?=!empty($search) ? $search : "" ?>" onchange="this.form.submit()"/>
	                    <span class="input-group-addon"><span class="glyphicon glyphicon-time"></span>
	                    </span>
	                </div>
	            </div>
	        </div>
	        <script type="text/javascript">
	            $(function () {
	                $('#datetimepicker5').datetimepicker({
	                    pickTime: false
	                });
	            });
	        </script>
	    </div>
	</div>
  </div>   
</form>

<?php echo isset($warning) ? '<div class="alert bg-danger">'.$warning.'</div>' : "" ?>

<form method="get" action="<?=site_url('importw/printExcel') ?>">
	<p><button type="submit" name="date" value="<?=isset($search) ? $search : "" ?>" class="btn btn-primary">Xuất file Excel</button></p>
</form>

<div class="table-responsive">
	<table class="table table-bordered">
		<thead>
			<tr align="center" class="success">
				<td>Sản phẩm</td>
				<td>Size</td>
				<td>Code</td>
				<td>Kho</td>				
				<td>Ngày nhập</td>
			</tr>
		</thead>
		<tbody>
			<?php	
				$i = 1;			
				foreach ($history as $row):					
					
					echo "<tr align='center'>
						  <td>".$row->product."</td>
						  <td>".$row->size."</td>
						  <td>".$row->code."</td>
						  <td>".$row->storage."</td>
						  <td>".$row->date_created."</td>						  
						  </tr>
						  ";

					$i++;
				endforeach;
			?>
		</tbody>
	</table>
	<?=!empty($paging_history) ? "<div class='pull-right'><span>Tổng cộng: $total sản phẩm</span><br>$paging_history</div>" : "" ?>
</div>